package com.briup.jz.service.impl;

import com.briup.jz.bean.BaseUserRole;
import com.briup.jz.dao.BaseUserRoleMapper;
import com.briup.jz.dao.CertificationApplyMapper;
import com.briup.jz.service.IBaseUserRoleService;
import com.briup.jz.utils.CustomerException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BaseUserRoleServiceImpl implements IBaseUserRoleService {

    @Resource
    private BaseUserRoleMapper  baseUserRoleMapper;


    @Override
    public void saveOrUpdat(BaseUserRole baseUserRole) throws CustomerException {


        if ( baseUserRole.getId()!=null){
            //更新操作
            baseUserRoleMapper.updateByPrimaryKey( baseUserRole);
        }else {
            baseUserRoleMapper.insert( baseUserRole);
        }
    }

    @Override
    public BaseUserRole query(Long id) {

        return   baseUserRoleMapper.selectByPrimaryKey(id);
    }

    @Override
    public void deleteById(Long id) throws CustomerException {

        baseUserRoleMapper.deleteByPrimaryKey(id);
    }
}
